<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateTableMembers extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('members', function (Blueprint $table) {
            $table->bigIncrements('member_id');
            $table->string('username', 100)->index()->default('')->comment('账号');
            $table->string('password', 100)->nullable()->default('')->comment('密码');
            $table->string('nickname', 100)->nullable()->default('')->comment('昵称');
            $table->string('openid', 50)->nullable()->default('')->comment('openid');
            $table->unsignedTinyInteger('sex')->default(0)->comment("性别:0、未知 1、男性 2、女性");
            $table->text('headimgurl')->nullable()->comment('头像');
            $table->string('email', 100)->nullable()->default('')->comment('邮箱');
            $table->string('mobile', 30)->nullable()->default('')->comment('手机');
            // $table->integer('score')->default(0)->comment('积分');
            // $table->string('qrcode', 255)->nullable()->default('')->comment('个人二维码');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('members');
    }
}
